package homework;

import java.io.*;

/**
 * 读聊天信息
 */
public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("chaos.txt");
        InputStreamReader isr = new InputStreamReader(fis);
        BufferedReader br = new BufferedReader(isr);
        String line;
        while ((line = br.readLine())!=null){//缓冲字符流读取的内容赋给line,若不为null，则为真；为null，跳出循环，循环结束
            System.out.println(line);//换行输出
        }
        br.close();
    }
}
